Skip to content

refactor(git-hooks): call checks_staged_gone from the markdown, powershell and ruff format hooks - #15680

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15631-43300262497-1
Nov 12, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15631-43300262497-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15631

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The markdown-format, powershell-format and ruff-format pre-commit hooks each defined a local staged_gone function. Each hook now calls checks_staged_gone from the check-lib.sh it already sources, and the local definitions and their comments are gone. Part 1 already added checks_staged_gone to lib/git-hooks/check-lib.sh and the plugin copies, with the same body, so the hooks behave as before. Each plugin gets a patch changelog fragment.

Not verified

  • Tidy skipped: the change covers 3 areas (markdown-format, powershell-format, ruff-format) and the tidy cutoff is 1 area
  • markdown-check.test.sh, powershell-check.test.sh and ruff-check.test.sh were not run one by one: this lane runs only its named wrappers. check-affected reported 13 passed but does not list which suites, so the three named suites are left to the PR's CI
  • typos check skipped by check-affected because typos is not installed on this runner; left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI

Fix

  • plugins/markdown-format/git-hooks/markdown-check.sh: removed the local staged_gone definition and its comment; the call site now uses checks_staged_gone
  • plugins/powershell-format/git-hooks/powershell-check.sh: removed the local staged_gone definition and its comment; the call site now uses checks_staged_gone
  • plugins/ruff-format/git-hooks/ruff-check.sh: removed the local staged_gone definition and its comment; the call site now uses checks_staged_gone
  • .changes/markdown-format/work-resolve-issue-issue-15631-43300262497-1-8301b48f.md: new patch fragment, ### Changed, Internal restructuring, no behavior change.
  • .changes/powershell-format/work-resolve-issue-issue-15631-43300262497-1-b5823850.md: new patch fragment, ### Changed, Internal restructuring, no behavior change.
  • .changes/ruff-format/work-resolve-issue-issue-15631-43300262497-1-1429c825.md: new patch fragment, ### Changed, Internal restructuring, no behavior change.

Verification

The runner ran each check from the base copy against 8660838:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • Read plugins/{markdown-format,powershell-format,ruff-format}/lib/git-hooks/check-lib.sh:560-565 against each removed staged_gone: checks_staged_gone has the same two-line body in all three copies
  • Grep for '(^|[^_])staged_gone' across the repo: no matches, so nothing still defines or calls the old name, tests included
  • check-changelog-fragments: all 33 fragments under .changes/ are valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 13 passed, 6 skipped (ruff: no .py changed; typos: not installed; three validate-plugins steps that run code from the checked tree; changed-skills: none), over 6 changed files
  • Fresh-context review subagent over the diff: no findings. It confirmed each hook sources check-lib.sh before the call, that no test names either function, and that control flow around each call site is unchanged
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43300262497

Left out: the items under Not verified.

Related

#15631

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 866083801c3ebad64097c1de80d347b2b40a90be: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #15680

No security issues found.

What changed. The markdown-format, powershell-format and ruff-format pre-commit hooks each had their own copy of a staged_gone function. This PR deletes those copies and calls checks_staged_gone instead, which comes from the check-lib.sh each hook already sources. It also adds three patch changelog fragments with identical content. I read the first fragment and skipped its two copies.

What I checked.

Scope notes.

  • No trusted path, trust control, merge hold, workflow, token scope or plugin manifest is touched.
  • No standing instruction (CLAUDE.md, AGENTS.md, a skill or agent body, or a hook block list) is deleted or narrowed, so the instruction-surface lens and the manifest checks did not apply.
  • The PR context file contains no embedded directives aimed at this lane.
  • No spend or billing impact.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 866083801c3ebad64097c1de80d347b2b40a90be: read 6 of 6 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings.

This PR removes the local staged_gone helper from the markdown-format, powershell-format and ruff-format pre-commit hooks. Each hook now calls checks_staged_gone from the check-lib.sh it already sources. It also adds a patch changelog fragment for each of the three plugins.

What I checked:

  • Same body in every copy. checks_staged_gone exists in the source library and in all three plugin copies, and its body is the same as the removed function's: lib/git-hooks/check-lib.sh:560 and plugins/{markdown-format,powershell-format,ruff-format}/lib/git-hooks/check-lib.sh:562, for example markdown-format copy.
  • Library loaded first. Each hook sources check-lib.sh before its candidate loop, either from beside the hook or from ../lib/git-hooks/. See markdown-check.sh:34-37, powershell-check.sh:45-48 and ruff-check.sh:33-36. The new name resolves at each call site.
  • Control flow unchanged. The code around each of the three call sites (continue / kind=gone, kind=staged, gone+=) is unchanged.

Closing issue #15631 acceptance criteria:

  • No hook defines staged_gone, and the three hooks call checks_staged_gone: met. I read this in the diff; a test would catch a regression only if one exercises a staged file that is gone from the work tree, which I did not check.
  • Behavior unchanged: met by inspection. The function bodies are identical.
  • Diff edits only the listed files: met. It touches the three hooks and three .changes/ fragments.
  • Within 400 changed lines and 15 files: met (6 files, about 45 lines).
  • markdown-check.test.sh, powershell-check.test.sh and ruff-check.test.sh pass, and ci-status is green: not verified by me. The PR body leaves both to CI, and I ran nothing.

Changelog fragments: the three patch fragments match the issue's wording and the size of the change. Their content is identical, so I read the first one and counted the other two as its copies.

Spend: none beyond this review run.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 866083801c3ebad64097c1de80d347b2b40a90be, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 8660838

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-15680-866083801c3ebad64097c1de80d347b2b40a90be, expires on 2026-12-12.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=866083801c3ebad64097c1de80d347b2b40a90be rubric=8.4.13 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit b24f178 Nov 12, 2026
52 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15631-43300262497-1 branch November 12, 2026 21:27
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit b24f17808b6498cc256a74d3faf1fd959e2828d0; later checks count it verified from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share the formatter git-hooks' staged_gone check through check-lib.sh (part 2 of 2)

0 participants